#!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
@author LiuRi
@desc 本模块是一个测试文件，用来说明pydoc的读取内容
@date Thu 17 Dec 2020 07:21:18 AM UTC
说明：
classes:testclass()，具有function1()和function2()两个方法

function：test1()，test2()，test3()

Data：a，b
"""

import dramatiq
import requests
import sys
import logging

from dramatiq.brokers.redis import RedisBroker

redis_broker = RedisBroker(host="localhost", port=6379)
dramatiq.set_broker(redis_broker)

@dramatiq.actor
def count_words(url):
     response = requests.get(url)
     count = len(response.text.split(" "))
     print(f"There are {count} words at {url!r}.")



if __name__ == '__main__':
    sys.exit(count_words.send(sys.argv[1]))
